//
//  BaseViewController.m
//  lhpc_manager
//
//  Created by 赵永杰 on 2017/9/5.
//  Copyright © 2017年 zhaoyongjie. All rights reserved.
//

#import "BaseViewController.h"
#import "LoginViewController.h"

@interface BaseViewController ()<UIGestureRecognizerDelegate>

@end

@implementation BaseViewController

#pragma mark - LifeCycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    if (self.navigationController) {
        self.navigationController.interactivePopGestureRecognizer.delegate = self;
    }
    
    [HLNoteCenter addObserver:self selector:@selector(errorCodeAction:) name:LHErrorCodeMethod object:nil];
}

-(void)errorCodeAction:(NSNotification *)noti{
    
    NSInteger error_codeValue = [noti.object integerValue];
    
    if (error_codeValue == 3000){
        //登陆失效
        [self reLogin];
    }
    
}
-(void)reLogin{
    
    LHSetUserToken(@"");
    LHSetUserID(@"");
    LHSetUserPhone(@"");
    
    LoginViewController *vc = (LoginViewController *)LHGetSB_VC(@"Login");
    UINavigationController *nv = [[UINavigationController alloc] initWithRootViewController:vc];
    
    [self presentViewController:nv animated:YES completion:^{
        [HLProgressHUD showHudTipStr:@"登陆失效，请重新登录！"];
    }];
    
    
}


#pragma mark - Public

#pragma mark - Private

- (void)setupChildViews {
    
}

#pragma mark - UITableViewDelegate

#pragma mark - Getter

#pragma mark - Setter

@end
